<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simInsertVoxelsIntoOctree</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1>Regular API function</h1>
<h3 class=subsectionBar><a name="simInsertVoxelsIntoOctree" id="simInsertVoxelsIntoOctree"></a>simInsertVoxelsIntoOctree / sim.insertVoxelsIntoOctree </h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Inserts voxels into an <a href="../octrees.htm">OC tree</a>. Each voxel will store a color and a tag value. See also <a href="simRemoveVoxelsFromOctree.htm">sim.removeVoxelsFromOctree</a> and the other <a href="../apiFunctions.htm#octree">OC tree related functions</a>.</td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simInt simInsertVoxelsIntoOctree(simInt octreeHandle,simInt options,const simFloat* pts,simInt ptCnt,const simUChar* color,const simUInt* tag,simVoid* reserved)</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>octreeHandle</strong>: the handle of the OC tree. See also <a href="simGetObjectHandle.htm">sim.getObjectHandle</a></div>
<div><strong>options</strong>: bit-coded:</div>
<div class=tab>bit0 set (1): specified points are relative to the OC tree reference frame, otherwise they are relative to the world reference frame</div>
<div class=tab>bit1 set (2): the color array contains one RGB triple per point, and the tag array contains one value per point. Otherwise it the color array contains a single RGB triple, and the tag array contains a single value.</div>
<div><strong>pts</strong>: a pointer to the voxel positions specified as X/Y/Z coordinates</div>
<div><strong>ptCnt</strong>: the number of point coordinates contained in pts</div>
<div><strong>color</strong>: a pointer to one or several RGB triples, specifying the red, green and blue color components (0-255). Can be nullptr.</div>
<div><strong>tag</strong>: a pointer to one or several uint32 values, which are user-defined values. Can be nullptr, and should be nullptr if <em>color</em> is nullptr.</div>
<div><strong>reserved</strong>: reserved for future extensions. Set to nullptr</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>-1 if operation was not successful, otherwise the total number of voxels in the OC tree</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>int totalVoxelCnt=sim.insertVoxelsIntoOctree(int octreeHandle,int options,table[] points,table[] color=nil,table[] tag=nil)</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div>Similar to the C-function counterpart</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div>Similar to the C-function counterpart</div>
</td> 
</tr> 
</table> 


<br>
</td>
</tr>
</table>
</div>
</body>
</html>
